package com.company.book_store.service;

import com.company.book_store.dao.BoodaoImpl;
import com.company.book_store.dao.Ibookdao;
import com.company.book_store.pojo.Book;

import java.util.List;

public class BookserviceImpl implements Ibookservice{
    private Ibookdao ibookdao=new BoodaoImpl();
    @Override
    public List<Book> selectall(int num) {
        List<Book>list=null;
        list=ibookdao.selectall(num);
        return list;
    }

    @Override
    public List<Book> selectlike(int num, String str) {
        List<Book>list=null;
        list=ibookdao.selectlike(num,str);
        return list;
    }

    @Override
    public Book selectBybookid(int num) {
        if(ibookdao.selectBybookid(num)!=null)
        {
            return ibookdao.selectBybookid(num);
        }
        return null;
    }

    @Override
    public int updatePlus(int num, int cnt) {
        return ibookdao.updatePlus(num,cnt);
    }

    @Override
    public int deleteBybookid(int num) {
        return ibookdao.deleteBybookid(num);
    }

    @Override
    public int updatebook(Book book) {
        return ibookdao.updatebook(book);
    }

    @Override
    public int addbook(Book book) {
        return ibookdao.addbook(book);
    }

}
